Skip to main content

Data Modeling

supOS uses UNS (Unified Namespace) to organize data into a clear, tree-like structure. Each folder and file in the model automatically generates an MQTT topic, making it easy to get real-time data.

Things to Notice before Start

Page Overview

Select UNS > Namespace after logging in to supOS, you will see the main page of this module.

No.ItemDescription
1ModelTree view of data models already built in UNS
TemplateTree view of data model templates already built in UNS
LabelDisplays labels, and models under each label
2Displays data models by category: Text/Template/Label.
/Search data models / Refresh data model list.
/Create folder-file structured data models based on data hierarchy.
Create data models by manually inputting JSON.
3Raw TopicsLists the topics received in the internal broker, which can be transformed to data models. For details, see Building Models through MQTT.
4OverviewComprehensive view of existing folders and files, and the number of connections between data sources and the internal MQTT broker
5Topology MapVisualizes the data flow using a topology diagram
6Import/ExportImport/export data models in JSON or Excel format

Extra Parameter Definition

  • Folder
ItemDescription
Extended InfoAdd extended information for the folder. Eg. unit.
TemplateSelect a template to inherit attributes from it. See Building Template.
Generate TemplateClick icon to add an attribute to the folder, at the same time you can select to generate a same template for future use.
  • File-Data Type
TypeDescription
Time SeriesReceive real-time data and store it in TDEngine.
RelationalReceive relational data and store it in a Postgres database.
CalculationPerform basic calculations on the added time series attributes.
AggregationAggregate the added data sources into JSON at a fixed frequency.
ReferenceSelect an existing file and copy its attributes.
  • File-Attribute Generation Method
Attribute Generation MethodDescription
CustomCustomize attributes.
TemplateInherit attributes from the selected template.
Reverse GenerationUse JSON text or connected databases to generate attributes with the same structure.
info

You can connect databases under DevTools > DBConnect. For details, see Database Connection.

  • File-Linked Operation
ItemDescription
PersistenceEnable historical data storage for the selected file.
Mock DataGenerates a data flow with mock data in UNS > SourceFlow.
Auto-DashboardGenerates a dashboard in System > Dashboards.

How to Build a Data Model

Based on simple folder-file structure, you can define the data hierarchy to a tree map.

Building Models Manually

note

Factory/workshop/equipment/CNC will be used as an example, in which Factory, workshop and equipment are folders and CNC is a file.

  1. Log in to supOS, and then select UNS > Namespace.
  2. Under Model, click to add a folder (e.g. factory).
  1. Select equipment, and then click to add a file (e.g.CNC) under it.
  1. Enter the information of the file based on the data tag, and then click Next.
  2. Select Persistance to enable history data storage, and then click Save.

Generating Models through JSON

  1. Log in to supOS, and then select UNS > Namespace.
  2. Click on the Model page.
  1. Select the data type, and then write JSON text for the model according to the data tree structure.
{
"Factory1": {
"workshop1": {
"equipment1": {
"CNC1": [
{
"actualRuntime1": 1380,
"plannedRuntime1": 1440
}
]
}
}
}
}
  1. Click Next, and select the model on the left side.
tip

Click on each data level, you can change its information and add attributes on the right side.

  1. Click Save.

Building Models through MQTT

  1. Use an MQTT client to connect to the internal broker of supOS-CE.
  • Host: Your supOS-CE domain.
  • Port: 1883.
  1. Define a topic and message payload on the client, and then send it to supOS.
  1. Log in to supOS, and then select UNS > Namespace.
  2. Expand Raw Topics, find the topic you defined.
  3. Click Topic to File icon next to the topic, and then edit the file and complete the namespace creation.

Importing Models

  1. Log in to supOS, and then select UNS > Namespace.
  2. Click Import at the upper-right corner, and then click Download Template.
  1. Fill in the template table.
tip

You can manually add a folder and file, export it and use it as an example for import.

  1. Save the template table, and then click Import on the Namespace page.
  2. Select the template, and then click Save.

Optional Features

Building Template

  1. On the Namespace page, click Template.
  2. Click , and then enter the information of the template.
tip

Click Source to select added models and inherit their attributes.

  1. Click Save.

Creating Label

Labels are used for categorizing data models.

  1. On the Namespace page, click Label.
  2. Click , and then enter the label name.
  3. Click Save, and then click to add files under the label.
  1. Click Save.